package com.grape.springbootgradle20220520.network;

import java.rmi.RemoteException;
import java.rmi.registry.LocateRegistry;
import java.rmi.registry.Registry;
import java.rmi.server.UnicastRemoteObject;

/**
 * @Author pan_jin
 * @Description: $
 * @Date: 2022/5/25 9:10
 * @Version: 1.0.0
 * @Slogan: 梦想还是要有的万一实现了呢
 */
public class Server {
    public static void main(String[] args) throws RemoteException {
        WorkClock workClock = new WorkClockService();
        WorkClock remote = (WorkClock) UnicastRemoteObject.exportObject(workClock, 0);
        Registry registry = LocateRegistry.createRegistry(1099);
        registry.rebind("WorkClock",remote);
    }
}
